<?php

Yii::import('application.models._base.BaseMessageGroup');

class MessageGroup extends BaseMessageGroup
{
	public static function model($className=__CLASS__) {
		return parent::model($className);
	}

    public function getMessageGroup($group_id){
        $db = Yii::app()->db->createCommand();
        $info = $db
            ->from('{{message_group}}')
            ->where('group_id=:group_id AND status=:status',array(':group_id'=>$group_id,':status'=>1))
            ->order('create_time desc')
            ->queryAll();
        return $info;
    }
    public function getOneMessageGroup($group_id){
        $db = Yii::app()->db->createCommand();
        $info = $db
            ->from('{{message_group}}')
            ->where('group_id=:group_id AND status=:status',array(':group_id'=>$group_id,':status'=>1))
            ->order('create_time desc')
            ->queryRow();
        return $info;

    }


}